// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store/index'
import Avue from '/static/avue/lib/avue.min'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '/static/avue/lib/index.css'
import '@/common/css/reset.scss'
import { cloneDeep, uniqBy, isEqual } from 'lodash-es'
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import VXETablePluginElement from 'yt-table-plugin-element'
import ShytTable from 'shyt-table'
import filters from './filters'
import '@/assets/icons'
import Tinymce from '@/components/tinymce/index.vue'
import '/static/editor.main.css'
import '@/assets/iconfont/iconfont.css'
import '@/common/css/common.scss'
import axios from '@/http/axios'
import './permission'
import ECharts from 'vue-echarts'
import VueSuperSlide from 'vue-superslide'
import directiveList from '@/directive/index'
import figlet from 'figlet'
import Doh from 'figlet/importable-fonts/Doh.js'
// import dayjs from 'dayjs'

const print = console
if (process.env.NODE_ENV === 'production') {
	figlet.parseFont('Doh', Doh)
	figlet.text(
		'SHYT',
		{
			font: 'Doh',
		},
		function (err, data) {
			print.log(`%c${data}`, 'color: #1890FF')
			print.log('%c上海翊廷, 一直为您服务!', 'color: #1890FF')
		},
	)
}

Vue.use(VueSuperSlide)
Vue.component('VChart', ECharts)
Vue.use(Avue)
directiveList.forEach(i => {
	Vue.directive(i.name, i.value)
})
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]))
VXETable.use(VXETablePluginElement)

Vue.prototype._ = {
	cloneDeep,
	uniqBy,
	isEqual,
}

Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.use(ElementUI, {
	size: window.localStorage.getItem('size') || 'medium',
})
Vue.use(VXETable)
Vue.use(ShytTable)
Vue.component('Tinymce', Tinymce)
// Vue.prototype.dayjs = dayjs
new Vue({
	router,
	store,
	render: h => h(App),
}).$mount('#app')
